home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ X-Mouse Options 2.xpl < prev    next >
Text File  |  2003-11-19  |  3KB  |  118 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="6"
  3. "COUNT"="2"
  4. "UIPATH"="Hardware\Mouse\X-Mouse"
  5. "NAME"="X-Mouse Options 2K/ME/XP"
  6. "OSVERSION"="0001111"
  7. "VERSION"="3.02"
  8. "LANGUAGE"="VBScript"
  9. "TEXT 1"="Activate window when mouse passes it (X Windows Style)"
  10. "TEXT 2"="Bring active window to foreground if XMouse activates it"
  11. "DESCRIPTION 1"="If the first option is activated, a window is activated a soon as the mouse pointer is over it."
  12. "DESCRIPTION 2"="The first option should ONLY be enabled, if "Snap To Default Button" is disabled, OR if the second option is enabled also. Else the results might be very "strange"!
  13. "AUTHOR"="Xteq Systems"
  14. "CONTACTURL"="http://www.xteq.com"
  15. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  16. "COMMENT 1"=" "
  17. "COMMENT 2"="Thanks also to CptSiskoX for the bug-report and the X-Mouse setting!"
  18.  
  19.  
  20.  
  21. '0x01 = Actvate Window on mouse
  22. c_ValMouseAct=&H01
  23. '0x40 = Bring Window to front
  24. c_ValMouseFront=&H40
  25.  
  26.  
  27. Sub Plugin_Initialize 
  28.  if RegValueExists(UPM_GetUPMRegPath) then
  29.     if UPM_IsValueActivated(c_ValMouseAct)=true then
  30.        Call SetUIElement(1,true)
  31.     end if
  32.  
  33.     if UPM_IsValueActivated(c_ValMouseFront)=true then
  34.        Call SetUIElement(2,true)
  35.     end if
  36.  
  37.  else
  38.     Call Disable
  39.  end if
  40.  
  41. End Sub
  42.  
  43. Sub Plugin_CheckData(ElementIndex)
  44. End Sub
  45.  
  46. Sub Plugin_Apply(ElementIndex,ElementSubIndex)
  47.  bVal1=GetUIElement(1)
  48.  bVal2=GetUIElement(2)
  49.  
  50.  if bVal2=true and bVal1=false then
  51.     bVal1=true 'second option only with first option together!
  52.  end if
  53.  
  54.  
  55.  Call UPM_SwitchValue(c_ValMouseAct,bVal1)
  56.  Call UPM_SwitchValue(c_ValMouseFront,bVal2)
  57.  
  58.  Call SetUIElement(1,bVal1)
  59.  Call SetUIElement(2,bVal2)
  60.  
  61.  
  62.  Call Logoff()
  63. End Sub
  64.  
  65. Sub Plugin_Terminate 
  66. End Sub
  67.  
  68.  
  69. '----------------------------------------------------
  70. '*** UPM (UserPrefenceMask) Functions Version 1.0 ***
  71. '----------------------------------------------------
  72.  
  73. Function UPM_GetUPMRegPath
  74.  if GetWinVer=1 or GetWinVer=3 or GetWinVer=5 then '95/98/ME
  75.     UPM_GetUPMRegPath="HKCU\Control Panel\Desktop\UserPreferenceMask"
  76.  else 'NT/2K/XP (?)
  77.     UPM_GetUPMRegPath="HKCU\Control Panel\Desktop\UserPreferencesMask"
  78.  end if   
  79. End Function
  80.  
  81. Function UPM_IsValueActivated(ValueInHEX)
  82.  UPM_s=RegReadValue(UPM_GetUPMRegPath)
  83.  UPM_s=CStr(UPM_s)
  84.  UPM_s=left(UPM_s,2) 'extract first byte
  85.  UPM_sV="&H" & UPM_s 'convert to HEX
  86.  
  87.  if UPM_sV and ValueInHEX then
  88.     UPM_IsValueActivated=true
  89.  else
  90.     UPM_IsValueActivated=false
  91.  end if
  92. End Function
  93.  
  94. Sub UPM_SwitchValue(ValueInHEX,BoolActivated)
  95.  b=UPM_IsValueActivated(ValueInHEX)
  96.  if b=true and BoolActivated=true then
  97.     'do nothing, value already activated
  98.  else
  99.     if b=false and BoolActivated=false then
  100.        'do nothing, value already deactivated
  101.     else
  102.        UPM_sAll=RegReadValue(UPM_GetUPMRegPath)
  103.        UPM_sAll=CStr(UPM_sAll)
  104.        
  105.        UPM_s=left(UPM_sAll,2) 'extract first byte 
  106.        UPM_sV="&H" & UPM_s
  107.  
  108.        if BoolActivated=true then
  109.           UPM_sV=UPM_sV+ValueInHEX
  110.        else
  111.           UPM_sV=UPM_sV-ValueInHEX
  112.        end if
  113.  
  114.        UPM_s=Hex(UPM_sV) & right(UPM_sAll,len(UPM_sAll)-2)
  115.        Call RegWriteValue(UPM_GetUPMRegPath,UPM_s,3)
  116.     end if
  117.  end if
  118. End Sub